/*    */ package com.zimbra.cs.servlet;
/*    */ 
/*    */ import com.zimbra.common.localconfig.KnownKey;
/*    */ import com.zimbra.common.localconfig.LC;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.ByteUtil;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.Server;
/*    */ import java.io.File;
/*    */ import java.io.FileInputStream;
/*    */ import java.io.IOException;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.ServletOutputStream;
/*    */ import javax.servlet.http.HttpServlet;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class RobotsServlet
/*    */   extends HttpServlet
/*    */ {
/*    */   private static final long serialVersionUID = 1058982623987983L;
/*    */   
/*    */   protected void doGet(HttpServletRequest request, HttpServletResponse response)
/*    */     throws ServletException, IOException
/*    */   {
/* 39 */     boolean keepOutCrawlers = false;
/*    */     try {
/* 41 */       keepOutCrawlers = Provisioning.getInstance().getLocalServer().isMailKeepOutWebCrawlers();
/*    */     }
/*    */     catch (ServiceException e) {}
/* 44 */     ServletOutputStream out = response.getOutputStream();
/*    */     try {
/* 46 */       out.println("User-agent: *");
/* 47 */       if (keepOutCrawlers) {
/* 48 */         out.println("Disallow: /");
/*    */       } else {
/* 50 */         out.println("Allow: /");
/*    */       }
/* 52 */       String extra = LC.robots_txt.value();
/* 53 */       File extraFile = new File(extra);
/* 54 */       if (extraFile.exists()) {
/* 55 */         FileInputStream in = new FileInputStream(extraFile);
/* 56 */         ByteUtil.copy(in, true, out, false);
/*    */       }
/* 58 */       out.flush();
/*    */     } finally {
/* 60 */       out.close();
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/servlet/RobotsServlet.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */